{-# LANGUAGE CPP, TemplateHaskell #-}
-----------------------------------------------------------------------------
--
-- Module      :  Main
-- Copyright   :
-- License     :  AllRightsReserved
--
-- Maintainer  :
-- Stability   :
-- Portability :
--
-- |
--
-----------------------------------------------------------------------------

module Main (
    main
) where

import Control.Monad (unless)
import Data.List (stripPrefix)
import System.Exit (exitFailure)

data BinTree a = Empty
                 | Node a (BinTree a) (BinTree a)
                              deriving (Show)

nodesLength :: BinTree a -> Int
nodesLength Empty = 0
nodesLength (Node _ left right) = 1 + (nodesLength left) + (nodesLength right)

main = do
    print $ nodesLength $ Node 7 (Node 8 (Node 1 Empty Empty) Empty) (Node 1 Empty Empty)

